﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediatorPattern.DemoTwo
{
    /// <summary>
    /// 抽象中介者
    /// </summary>
    public abstract class AbstractMediator
    {
        protected Purchase purchase;
        protected Sale sale;
        protected Stock stock;

        /// <summary>
        /// 構造函數
        /// </summary>
        public AbstractMediator() {
            purchase = new Purchase(this);
            sale = new Sale(this);
            stock = new Stock(this);
        }
        
        /// <summary>
        /// 中介者最重要的方法叫做事件方法，處理多個對象之間的關係
        /// </summary>
        /// <param name="str"></param>
        /// <param name="objects"></param>
        public abstract void execute(string str,params object[] objects);
    }


  
}
